﻿<%@ Import Namespace="ASPNETVN.PORTAL.Components.Helpers" %>

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ScrollingContent.aspx.cs" Inherits="KLP.Modules.HOME.ScrollingContent" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>ANNOUNCEMENT</title>
    <style type="text/css">
        body
        {
            font-family: Tahoma, Arial;
            font-size: 8pt;
            margin: 0px 0px 0px 0px;
            background-color: #000;
            background-image: url(../../Images/Master/KLP.Gold/ThongBaoBG.jpg);
        }
        #NewsDiv
        {
            position: relative;
            left: 0;
            top: 0;
            width: 100%;
        }
        a:link
        {
            color: #FFF;
            text-decoration: none;
        }
        a:visited
        {
            color: #FFF;
            text-decoration: none;
        }
        a:active
        {
            color: #FFF;
            text-decoration: none;
        }
        a:hover
        {
            color: #FFF;
            text-decoration: underline;
        }
    </style>
</head>
<body style="padding: 4px;" onmouseover="scrollspeed=0" onmouseout="scrollspeed=current" onload="NewsScrollStart();">
    <form id="form1" runat="server">
    <div id="NewsDiv" style="text-align:justify">
        <asp:Repeater ID="rptItem" runat="server">
            <ItemTemplate>
                <asp:HyperLink ID="HyperLink1" Font-Bold="true" runat="server" Target="_parent" NavigateUrl='<%# HttpUrlBuilder.BuildUrl(new Guid(Request.QueryString["mid"]), Convert.ToInt32(Eval("ID")), "ViewContent") %>' Text='<%# "» " + Eval("Title") %>'></asp:HyperLink>
                <br />
                <address>
                    <asp:Label ID="lblCreatedDate" runat="server" Font-Size="8pt" ForeColor="White" Text='<%# " Ngày đăng:" + Convert.ToDateTime(Eval("CreatedDate")).ToShortDateString()  %>'></asp:Label></address>
            </ItemTemplate>
            <SeparatorTemplate>
                <br />
            </SeparatorTemplate>
        </asp:Repeater>
    </div>

    <script language="JavaScript" type="text/javascript">

        var scrollspeed = "1"		// SET SCROLLER SPEED 1 = SLOWEST
        var speedjump = "40"		// ADJUST SCROLL JUMPING = RANGE 20 TO 40
        var startdelay = "2" 		// START SCROLLING DELAY IN SECONDS
        var nextdelay = "1" 		// SECOND SCROLL DELAY IN SECONDS 0 = QUICKEST
        var topspace = "2px"		// TOP SPACING FIRST TIME SCROLLING
        var frameheight = "200px"	// IF YOU RESIZE THE WINDOW EDIT THIS HEIGHT TO MATCH



        current = (scrollspeed)


        function HeightData() {
            AreaHeight = dataobj.offsetHeight
            if (AreaHeight == 0) {
                setTimeout("HeightData()", (startdelay * 1000))
            }
            else {
                ScrollNewsDiv()
            }
        }

        function NewsScrollStart() {
            dataobj = document.all ? document.all.NewsDiv : document.getElementById("NewsDiv")
            dataobj.style.top = topspace
            setTimeout("HeightData()", (startdelay * 1000))
        }

        function ScrollNewsDiv() {
            dataobj.style.top = parseInt(dataobj.style.top) - (scrollspeed)
            if (parseInt(dataobj.style.top) < AreaHeight * (-1)) {
                dataobj.style.top = frameheight
                setTimeout("ScrollNewsDiv()", (nextdelay * 1000))
            }
            else {
                setTimeout("ScrollNewsDiv()", speedjump)
            }
        }
    </script>

    </form>
</body>
</html>
